package com.qfedu.provider.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 评论
 * @TableName db_comment
 */
@TableName(value ="db_comment")
@Data
public class DbComment implements Serializable {
    /**
     * 评论id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 作品id
     */
    private Integer productId;

    /**
     * 评论的作品类型id
     */
    private Integer productTypeId;

    /**
     * 发布评论的人
     */
    private Integer userId;


    /**
     * 评论内容
     */
    private String content;

    /**
     * 逻辑删除    1存在  0删除
     */
    private Integer deleted;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    public DbComment(String content,  Integer productId, Integer productTypeId, Integer userId) {
        this.userId = userId;
        this.content = content;
        this.deleted = 1;
        this.productId = productId;
        this.productTypeId = productTypeId;
        this.updateTime = new Date();
        this.createTime = new Date();
    }
}